package Algorithm;

public class ArrayTest_04 {
    public String myToString(int[] array){
        StringBuilder stringBuilder=new StringBuilder();
        stringBuilder.append('[');
        for(int i=0;i<array.length;i++){
            if(i== array.length-1){
                stringBuilder.append(array[i]);
            }else{
                stringBuilder.append(array[i]+", ");
            }
        }
        stringBuilder.append(']');
        return stringBuilder.toString();
    }
    public static void main(String[] args) {
        ArrayTest_04 at4=new ArrayTest_04();
        int[] array=new int[]{12,3,45,6,78,9};
        System.out.println(at4.myToString(array));
    }
}
